//
//  OnePicture.m
//  Four_Fit_New
//
//  Created by lanou on 16/7/14.
//  Copyright © 2016年 xmaz. All rights reserved.
//

#import "OnePicture.h"
#import "Community.h"
#import "comment.h"
#import "ShowPicture.h"

#define GQkeyWindow [UIApplication sharedApplication].keyWindow
@interface OnePicture ()
@property (weak, nonatomic) IBOutlet UIImageView *picture;

/** <#注释#> */
@property (nonatomic, strong) NSString *picUrl;
@end

@implementation OnePicture

+ (instancetype)onePicture
{
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
}

- (void)setCommunity:(Community *)community {
    
    _community = community;
    
    [self.picture sd_setImageWithURL:[NSURL URLWithString:community.pic[0]]];
//    self.picUrl = community.pic[0];
}

- (void)setComment:(comment *)comment {
    _comment = comment;
    
    [self.picture sd_setImageWithURL:[NSURL URLWithString:comment.pic[0]]];
//    self.picUrl = comment.pic[0];
}


- (void)awakeFromNib {
    self.autoresizingMask = UIViewAutoresizingNone;
    
    self.picture.userInteractionEnabled = YES;
    [self.picture addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showPicture)]];
}

- (void)showPicture {
    
    
    
    [ShowPicture showImage:self.picture];
    
}

@end
